A computer operates under the control of programs consisting of coded instructions called “object code” that execute on the computer. But, object code is not readily understood by humans, so a human programmer typically writes programs in a high-level programming language, such as BASIC, JAVA, PERL, PASCAL, C, C++, or the like, which are easier to understand. High-level languages generally have a precise syntax that defines certain permitted structures for statements in the language and their meaning. A translator such as a compiler translates the high-level language statements, called “source code” into object code. Thus, the terms “source code” and “object code” describe the form of a program prior to and after translation, respectively. Accordingly, the term “source code” generally refers to a program in its high-level programming language form. “Object code,” on the other hand, generally refers to the program in the form of the coded instructions generated by the translator that are executable on a computer.
Typically, this translator is itself a program, which might be a compiler or an interpreter. A compiler is a program that translates all the source code into target code, which can be object code or byte code, prior to execution on the computer. An interpreter is a program that executes the source code by translating source statements into an “intermediate form” or data structure that is subsequently executed. The intermediate form is neither source code nor object code, but rather a structure that the interpreter can execute indirectly. The interpreter's translation into this intermediate form may be done at any granularity, from one statement at a time as needed to execute, all the way to a whole program at a time.
Writing computer programs, even in high-level source code, is a time-consuming and laborious process for the computer programmer. For many programs and programmers, the time to write a program is the most critical consideration. But, prior programming languages have significantly under-emphasized programmer convenience in language design. For example, many programming languages require the programmer to write code that merely performs bookkeeping functions, such as counting the number of times that some action has been taken. This bookkeeping code is tedious to write and prone to errors. Further, this bookkeeping code distracts the programmer from the main tasks of the program and lowers the programmer's productivity.
Thus, there is a need for programming language features that make writing programs easier and more convenient, in order to boost programmer productivity.